import request from "../utils/request.js"
export default {
	//骑手获取订单列表
	getOrderListByRider(riderId, status) {
		return request.get(`/app-api/order/getOrderListByRider?riderId=${riderId}&status=${status}`)
	},
	//骑手送达
	delivery(orderId, riderId) {
		return request.get(`/app-api/order/delivery?orderId=${orderId}&riderId=${riderId}`)
	},
	//骑手扫码取餐
	scanCodes(orderId) {
		return request.get(`/app-api/order/scanCodes?orderId=${orderId}`)
	},
	//骑手取餐
	takeFood(orderId, riderId) {
		return request.get(`/app-api/order/takeFood?orderId=${orderId}&riderId=${riderId}`)
	},
	//获取订单详情
	getOrderInfoById(orderId) {
		return request.get(`/app-api/order/getOrderInfoById?orderId=${orderId}`)
	},
	ruleTime(time, point) {
		let date = new Date(time)
		let year = date.getFullYear()
		let month = date.getMonth() + 1
		month = month < 10 ? '0' + month : month
		let day = date.getDate()
		day = day < 10 ? '0' + day : day
		let hour = date.getHours()
		hour = hour < 10 ? '0' + hour : hour
		let minute = date.getMinutes()
		minute = minute < 10 ? '0' + minute : minute
		let second = date.getSeconds()
		second = second < 10 ? '0' + second : second
		return `${year}-${month}${point ? '.' : '-'}${day} ${hour}:${minute}:${second}`
	}
}